<?php
require '../conn.php';
require 'config.php';
require '../inc/function.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/admin.css" type="text/css" />
<script type="text/javascript" src="inc/function.js"></script>
</head>
<body>
<?php
if ($act=='modify'){
	$s_code=ReStra(trim($_POST['s_code']));
	$s_name=ReStra(trim($_POST['s_name']));
	$s_image=ReStra($_POST['s_image']);
	$s_m1=ReStra($_POST['s_m1']);
	$s_m2=ReStra($_POST['s_m2']);
	$image_original=RsField_Array('select s_image from '.$language.'_security where s_id='.$id);
	if ($s_image!=$image_original[0]) DeleteFile('../'.$image_original[0]);
	$sql="update ".$language."_security set s_code='$s_code',s_name='$s_name',s_image='$s_image',s_m1='$s_m1',s_m2='$s_m2' where s_id=$id";
	mysql_query($sql) or die(mysql_error($sql));
	Msg('','security.php?'.$urls);
}
$query=mysql_query('select * from '.$language.'_security where s_id='.$id,$conn);
$row=mysql_fetch_array($query);
?>
<div id="container">
  <div class="edit">
      <h1>防伪码管理<a href="javascript:location.reload();">刷新</a></h1>
      <form name="form1" method="post" action="?act=modify&<?php echo $urls.'&id='.$id ?>" onsubmit="return CheckSecurity(this);">
        <table id="protbe" width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
            <td class="edit_title">防 伪 码：</td>
            <td><input type="text" name="s_code" class="inputtext" value="<?php echo $row['s_code'] ?>" size="50" maxlength="50" /></td>
          </tr>
          <tr>
            <td class="edit_title">产品名称：</td>
            <td><input type="text" name="s_name" class="inputtext" value="<?php echo $row['s_name'] ?>" size="50" maxlength="50" /></td>
          </tr>
          <tr>
            <td class="edit_title">产品图片：</td>
            <td><input type="text" name="s_image" id="s_image" class="inputtext" value="<?php echo $row['s_image'] ?>" size="50" readonly="readonly" />&nbsp;(图片尺寸：300*225)<iframe src="../upload_fy.php?file_type=0&file_id=s_image" frameborder="0" allowtransparency="true" scrolling="no" width="100%" height="25"></iframe></td>
          </tr>
		  <tr>
            <td class="edit_title">出 口 国：</td>
            <td><input type="text" name="s_m1" class="inputtext" value="<?php echo $row['s_m1'] ?>" size="50" maxlength="50" /></td>
          </tr>
		  <tr>
            <td class="edit_title">进 口 国：</td>
            <td><input type="text" name="s_m2" class="inputtext" value="<?php echo $row['s_m2'] ?>" size="50" maxlength="50" /></td>
          </tr>
          <tr>
            <td class="edit_title" height="30">&nbsp;</td>
			<td><input type="submit" name="button" class="button" value=" 保存 " />&nbsp;&nbsp;<input type="button" name="button" class="button" value=" 返回 " onclick="location.href='security.php?<?php echo $urls ?>'" /></td>
          </tr>
        </table>
    </form>
    </div>
</div>
</body>
</html>